package ab.mes.service.impl;

import ab.mes.entity.ProcessFirstInspection;
import ab.mes.mapper.ProcessFirstInspectionMapper;
import ab.mes.service.ProcessFirstInspectionService;
import ab.mes.tools.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ProcessFirstInspectionServiceImpl implements ProcessFirstInspectionService {
    @Autowired
    ProcessFirstInspectionMapper processFirstInspectionMapper;

    //根据工序名查询工序的所有首检项
    public Result selectByProcess(String process){
        Result result = new Result();
        result.getMap().put("process_first_inspection",processFirstInspectionMapper.selectByProcess(process));
        return result;
    }
    //根据检查项名查询工序的所有首检项
    public Result selectByName(String name){
        Result result = new Result();
        result.getMap().put("process_first_inspection",processFirstInspectionMapper.selectById(name));
        return result;
    }
    //为某个工序插入首检项
    public Result insertInspection(ProcessFirstInspection processFirstInspection){
        Result result = new Result();
        result.getMap().put("process_first_inspection",processFirstInspectionMapper.insert(processFirstInspection));
        return result;
    }

}
